
import { connect } from 'react-redux'
import MySoldList from '../../../../views/My/MyUtils/MyBeans/MySoldList'

function mapStateToProps(state: any) {
    return {
        userInfo: state.user.userInfo,
        userBeanSoldListAll: state.user.userBeanSoldListAll,
        userBeanSoldListSold: state.user.userBeanSoldListSold,
        userBeanSoldListUnsold: state.user.userBeanSoldListUnsold,
    }
}

function mapDispatchToProps(dispatch: (obj: any) => void) {
    return {
        'SET_MYUTILS_BEANSSOLDLIST': (data: any, type: number = 0) => {
            switch (type) {
                case 1: dispatch({ type: 'SET_MYUTILS_BEANSSOLDLISTUNSOLD', data }); break
                case 2: dispatch({ type: 'SET_MYUTILS_BEANSSOLDLISTSOLD', data }); break
                default: dispatch({ type: 'SET_MYUTILS_BEANSSOLDLISTALL', data }); break
            }
        },
    }
}

export default connect(mapStateToProps, mapDispatchToProps)(MySoldList)